const Router = require('koa-router');
const router = new Router();

router.get('/user/:id', async (ctx) => {
  const userId = ctx.params.id;
  ctx.body = {
    id: userId,
    name: `用户${userId}`,
    age: 20 + Number(userId)
  };
});

router.post('/user', async (ctx) => {
  ctx.body = { message: '用户创建成功' };
});

module.exports = router;